import React, { Component } from "react";
// import qs from "qs";

const DetailList = [
  { id: "01", content: "你好中国" },
  { id: "02", content: "你好美国" },
  { id: "03", content: "你好英国" },
];
export default class MessageD extends Component {
  render() {
    console.log(this.props);
    // const { id, title } = qs.parse(this.props.location.search.slice(1));
    const { id } = this.props.location.state;
    const res = DetailList.find(item=>item.id===id)
    // const finRes = DetailList.find(
    //   (item) => item.id === this.props.match.params.id
    // );
    return (
      <ul>
        <li>id:{id}</li>
        {/* <li>title:{title}</li> */}

        <li>内容:{res.content}</li>
      </ul>
    );
  }
}





